package com.smrs.basicdata.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 部门状态枚举列表
 * @author Jonathan
 *
 */
public enum StoreTypeEnum {
	major(1,"总仓"),region(2,"区域仓"),normal(3,"门店");
	private Integer id;
	private String name;
	private static final Map<Integer, StoreTypeEnum> CACHE = new HashMap<Integer, StoreTypeEnum>(){
		{
			for(StoreTypeEnum enu : StoreTypeEnum.values()){
				put(enu.getId(), enu);
			}
		}
		private static final long serialVersionUID = -8986866330615001847L;
	};

	private StoreTypeEnum(Integer status, String description) {
		this.id = status;
		this.name = description;
	}
	
	public Integer getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDescription() {
		return name;
	}
	
	public static StoreTypeEnum toEnum(Integer id){
		return CACHE.get(id);
	}
}
